/**
 * 
 */
package com.googlecode.bestpaper.output.pdf.typeface;

import com.googlecode.bestpaper.output.pdf.PDFHelper;
import com.googlecode.bestpaper.syntax.typeface.BPBold;
import com.lowagie.text.Chunk;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;

/**
 * @author xalinx at gmail dot com
 * @date Dec 4, 2009
 */
public class PDFBold extends BPBold<Paragraph, Paragraph> {

	/**
	 * @param content
	 */
	public PDFBold(String content) {
		super(content);
	}

	@Override
	protected Paragraph buildSelf(Paragraph para, int fontStyle) throws Exception {
		if (this.getContent() != null) {
			Font font = PDFHelper.getCNFont(fontStyle);
			Chunk chunk = new Chunk(this.getContent(), font);
			para.add(chunk);
		}
		return para;
	}

	/* (non-Javadoc)
	 * @see com.googlecode.bestpaper.syntax.typeface.BPTypeface#getFontStyle(int)
	 */
	@Override
	protected int getFontStyle(int fontStyle) {
		return Font.BOLD | fontStyle;
	}

}
